package com.nuaa.controller.jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;

public class JsoupDemo {

	@Test
	public void test() {
		String html = "<html><head><title>First parse</title></head>"
				  + "<body><p>Parsed HTML into a doc.</p>"
				  + "<p>An <a href='http://example.com/'><b>example</b></a> link.</p>"
				  + "</body></html>";
		Document doc = Jsoup.parse(html);
		System.out.println(doc.getElementsByTag("title").html());
		System.out.println(doc.title());
		System.out.println(doc.getElementsByTag("p").html());
		System.out.println(doc.getElementsByTag("a").text());
	}
}
